// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_hm_message_metadata
// * CreateDate    : 2014-06-05 18:29:59
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:29:59
// * LastChanger   : 2014-06-05 18:29:59
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class HmMessageMetadataEntity : EntityBase
    {
        public HmMessageMetadataTable TableSchema
        {
            get
            {
                return HmMessageMetadataTable.Current;
            }
		}
		
		public HmMessageMetadataEntity()
        {

        }
		
		public HmMessageMetadataEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.MetadataId = Convert.ToInt64(CommonFunctions.ToObject(dr["metadata_id"]));
			this.MetadataAccountid = Convert.ToInt32(CommonFunctions.ToObject(dr["metadata_accountid"]));
			this.MetadataFolderid = Convert.ToInt32(CommonFunctions.ToObject(dr["metadata_folderid"]));
			this.MetadataMessageid = Convert.ToInt64(CommonFunctions.ToObject(dr["metadata_messageid"]));
			this.MetadataDateutc = Convert.ToDateTime(CommonFunctions.ToObject(dr["metadata_dateutc"]));
			this.MetadataFrom = Convert.ToString(CommonFunctions.ToObject(dr["metadata_from"]));
			this.MetadataSubject = Convert.ToString(CommonFunctions.ToObject(dr["metadata_subject"]));
			this.MetadataTo = Convert.ToString(CommonFunctions.ToObject(dr["metadata_to"]));
			this.MetadataCc = Convert.ToString(CommonFunctions.ToObject(dr["metadata_cc"]));
        }
		
		public HmMessageMetadataEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.MetadataId = Convert.ToInt64(CommonFunctions.ToObject(dr["metadata_id"]));
			this.MetadataAccountid = Convert.ToInt32(CommonFunctions.ToObject(dr["metadata_accountid"]));
			this.MetadataFolderid = Convert.ToInt32(CommonFunctions.ToObject(dr["metadata_folderid"]));
			this.MetadataMessageid = Convert.ToInt64(CommonFunctions.ToObject(dr["metadata_messageid"]));
			this.MetadataDateutc = Convert.ToDateTime(CommonFunctions.ToObject(dr["metadata_dateutc"]));
			this.MetadataFrom = Convert.ToString(CommonFunctions.ToObject(dr["metadata_from"]));
			this.MetadataSubject = Convert.ToString(CommonFunctions.ToObject(dr["metadata_subject"]));
			this.MetadataTo = Convert.ToString(CommonFunctions.ToObject(dr["metadata_to"]));
			this.MetadataCc = Convert.ToString(CommonFunctions.ToObject(dr["metadata_cc"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return HmMessageMetadataTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public long MetadataId
        {
            get { return Convert.ToInt64(GetData(HmMessageMetadataTable.C_metadata_id)); }
            set { SetData(HmMessageMetadataTable.C_metadata_id, value); }
        }
		
        [DataMember]
        public int MetadataAccountid
        {
            get { return Convert.ToInt32(GetData(HmMessageMetadataTable.C_metadata_accountid)); }
            set { SetData(HmMessageMetadataTable.C_metadata_accountid, value); }
        }
		
        [DataMember]
        public int MetadataFolderid
        {
            get { return Convert.ToInt32(GetData(HmMessageMetadataTable.C_metadata_folderid)); }
            set { SetData(HmMessageMetadataTable.C_metadata_folderid, value); }
        }
		
        [DataMember]
        public long MetadataMessageid
        {
            get { return Convert.ToInt64(GetData(HmMessageMetadataTable.C_metadata_messageid)); }
            set { SetData(HmMessageMetadataTable.C_metadata_messageid, value); }
        }
		
        [DataMember]
        public DateTime MetadataDateutc
        {
            get { return Convert.ToDateTime(GetData(HmMessageMetadataTable.C_metadata_dateutc)); }
            set { SetData(HmMessageMetadataTable.C_metadata_dateutc, value); }
        }
		
        [DataMember]
        public string MetadataFrom
        {
            get { return Convert.ToString(GetData(HmMessageMetadataTable.C_metadata_from)); }
            set { SetData(HmMessageMetadataTable.C_metadata_from, value); }
        }
		
        [DataMember]
        public string MetadataSubject
        {
            get { return Convert.ToString(GetData(HmMessageMetadataTable.C_metadata_subject)); }
            set { SetData(HmMessageMetadataTable.C_metadata_subject, value); }
        }
		
        [DataMember]
        public string MetadataTo
        {
            get { return Convert.ToString(GetData(HmMessageMetadataTable.C_metadata_to)); }
            set { SetData(HmMessageMetadataTable.C_metadata_to, value); }
        }
		
        [DataMember]
        public string MetadataCc
        {
            get { return Convert.ToString(GetData(HmMessageMetadataTable.C_metadata_cc)); }
            set { SetData(HmMessageMetadataTable.C_metadata_cc, value); }
        }
		
		#endregion
	}
	
	
}	

